<template>
	<view class="plan card record-content">
		<view class="title">故障信息</view>
		<view>
			<view class="record-item" v-show="taskInfo?.memo">
				<text>故障关闭原因</text>
				<text>{{ taskInfo?.memo || '' }}</text>
			</view>
		<!-- 	<view class="record-item">
				<text>故障状态</text>
				<text>{{ useDictionaryStore().filterDictName('EamFaultStatus', taskInfo?.faultStatus || '') }}</text>
			</view>
			<view class="record-item">
				<text>故障等级</text>
				<text :class="taskInfo?.repairLevel == 1 ? 'red-color' : ''">{{ useDictionaryStore().filterDictName('EamFaultLevel', taskInfo?.repairLevel || '') }}</text>
			</view> -->
			<view class="record-item">
				<text>故障来源</text>
				<text>{{
                useDictionaryStore().filterDictName(
                  "EamFaultSource",
                  taskInfo?.repairSource
                )
              }}</text>
			</view>
			<view class="record-item">
				<text>报修时间</text>
				<text>{{ taskInfo?.repairTime || '' }}</text>
			</view>
			<view class="record-item">
				<text>报修人</text>
				<text>{{ taskInfo?.repairUserName || '' }}</text>
			</view>
			<view class="record-item">
				<text>故障描述</text>
				<text>{{ taskInfo?.remarks || '' }}</text>
			</view>
			<view v-if="taskInfo?.images">
				<!-- <text>故障图片</text> -->
				<upload-image :multiple="false" folderName="eam/equ/eamRepairOrders" :isRead="true" :accept="accept" camera="back" :list="taskInfo?.images" :capture="capture" style="margin-top: 9px" @fileChange="getSceneImages"></upload-image>
			</view>
		</view>
	</view>
</template>

<script setup name="RepairOrderInfo">
import { useDictionaryStore } from '@/stores/useDictionaryStore';
import UploadImage from '@/components/upload-image-ssr.vue';
const emit = defineEmits(['fileChange']);
const props = defineProps({
	taskInfo: {
		type: Object,
		default: () => {}
	}
});

const { taskInfo } = toRefs(props);

// 摄像头参数设置
const capture = ref(["camera",'album']);
const accept = ref('image');

// 是否折叠
const isCollapse = ref(false);

function getSceneImages(list) {
	emit('fileChange', list)
};
</script>

<style lang="scss" scoped>
.card {
	background-color: #fff;
	margin: 10px 10px;
	border-radius: 8px;
	padding: 12px 12px;
	transition: all 300ms ease;
	box-shadow: 0 2px 6px rgba(3, 121, 255, 0.05);
}
.title {
	font-size: 16px;
	margin: 6px 0 14px;
	font-weight: bold;
	.u-icon {
		margin-right: 3px;
	}
}
</style>
